1. Field
The invention relates generally to storage arrangements for reduced color-resolution image data in a memory, and particularly to methods and apparatus for efficiently accessing reduced color-resolution image data.
2. Description of the Related Art
Pixels defined in the YCbCr color space are described by a luma component (Y), and two chroma components (Cb, Cr). Each component is often represented by a one byte value. In addition, pixels in a digital image are arranged in raster order. A raster pattern refers to the scanning of an image from side-to-side in lines from top-to-bottom.
Commonly, digital images are stored into and fetched from a computer memory, and it is generally important to minimize the size of memory in computer systems. One technique sometimes employed for reducing memory requirements is reducing the color resolution of image data. The human eye is more sensitive to brightness than to color so the color resolution of an image can be lowered with modest visual impact. Color resolution is reduced by chroma subsampling. That is, while the luma information for every pixel in the image is sampled, the chroma information from fewer than all of the pixels is sampled. Reducing the color resolution of an image means that it can be stored in fewer bytes than is required to store the image at its full-resolution. Certain operations, however, can not be performed on a reduced color-resolution image. Accordingly, before these operations can be performed, the missing color information must be reintroduced into the image (by interpolation or repetition).
The color resolution of an image may be reduced horizontally, vertically, or in both dimensions. For example, if the color resolution is reduced horizontally, sampling is performed on groups of horizontally adjacent pixels in a line, such as a group of four adjacent pixels. The Y information of every pixel in the group is sampled, but the Cr and Cb information from less then every pixel is sampled. Reduction in the vertical direction is analogous, except sampling is performed on groups of vertically adjacent pixels in a column. On the other hand, if the color resolution is reduced both horizontally and vertically, sampling is performed on a group of pixels that are both horizontally and vertically adjacent, such as a group of two horizontally adjacent pixels in two vertically adjacent lines. As before, the Y information of every pixel in the group is sampled, but the Cr and Cb information from less then every pixel is sampled. For example, Cr information may be sampled from every other pixel on the odd-numbered lines, while Cb may be sampled from every other pixel on the even-numbered lines. When the color-resolution of the image has been reduced both horizontally and vertically, data access efficiency may suffer when the image is fetched for the purpose of reintroducing the missing color information.
Memory bandwidth refers to the amount of data that can be written to or read from a memory in a given time period, e.g., bytes per second. The amount of memory bandwidth available in a system depends on the memory clock frequency and the width of the memory bus. Given a particular bus width and frequency, there is a finite amount of bandwidth available in any given time period. The percentage of that finite amount of bandwidth being used at any time depends on the particular operation(s) being performed. It also depends on how efficiently those operations are performed. Systems must be designed so that there is always a sufficient amount of bandwidth available for performing necessary operations. Stated another way, a system should have enough bandwidth to accommodate peak and not merely average bandwidth requirements. However, as power consumption is proportional to clock frequency, it is desirable to limit the memory bandwidth (e.g., clock frequency) as much as possible, while still accommodating peak bandwidth requirements.
Of course, it is also desirable to have operations performed as efficiently as possible in terms of the number of memory accesses they need. Typically, memories formed from semiconductors are conceptually organized into rows and columns. When a memory is accessed, there is a maximum number of bytes at a particular row address that can be written or read in each access cycle. For example, if the memory bus is four bytes wide, it is possible (in an SRAM type memory) to access up to four bytes within a row in a single access. Sometimes four bytes from the specified row are needed, but at other times fewer than four may be needed. “Data access efficiency,” as the term is used herein, refers to the percentage of bytes available in a memory read cycle that are actually needed. Obviously, an operation that requires four memory cycles to fetch four bytes is less efficient than one that can fetch the four bytes in a single memory cycle. Similarly, the term also refers to the percentage of the maximum possible number of bytes that are actually stored in a memory write cycle.
Generally, an image will be transmitted for storing in a memory in raster order. A common way to store an image in memory is to store raster-ordered pixels at sequential memory addresses as they are received, which is an efficient way to store the image data. However, if an image in which the color-resolution has been reduced both horizontally and vertically is stored in raster order, data access efficiency can suffer when the image is fetched for the purpose of reintroducing the missing color information. This is because the Cr and Cb components needed to calculate missing color information are not stored “locally,” that is, they are not stored in the same row with the associated Y components.
Another situation where data access efficiency suffers is where a reduced color-resolution image is presented in raster order for storing in a memory and it is desired to display the image in a rotated orientation. An image may be rotated when it is stored into or when it is fetched from memory. Consider the case of rotating an image by 90 degrees upon storing. Further, assume that the color-resolution of the image has been reduced both horizontally and vertically. This operation typically requires that the image data be stored in such a way that fetching from sequential memory addresses provides a rotated, raster-ordered version of the image. The reason that “data access efficiency” suffers in this situation is because the Cr and Cb components needed to calculate missing color information for associated Y components should, for efficent fetching, be stored locally in the memory. However, the Cr and Cb components are not “local” to one another in the raster-ordered data stream presented for storage. First, two Y components and the Cr component from a first line will appear sequentially in the data stream. Later, two Y more components and the Cb component from pixels in the same image columns, but on the line below will appear sequentially in the data stream. The first and second groups of three components separated temporally by the time needed to store a line of image data. Accordingly, because there is a time delay before the second group can be stored, two memory accesses are needed.
Data access efficiency can also be penalized where a single storage arrangement is used for displaying an image in both rotated and non-rotated orientations. As an example, the frame to be displayed often includes two or more distinct images, e.g., a main window and one or more sub-windows. It is desirable to be able to rotate one image while not rotating the other. It is also desirable to store the entire frame using a single storage arrangement. However, displaying a main window without rotation while displaying a sub-window in a rotated orientation is a situation where data access efficiency suffers when the image is stored using certain storage arrangements.
Accordingly, there is a need for storage arrangements for reduced color-resolution image data, and particularly to methods and apparatus for efficiently accessing reduced color-resolution image data in a memory.